package com.graduation.rescuematerial.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.rescuematerial.dto.AppletOrderDTO;
import com.graduation.rescuematerial.dto.StatisticsDTO;
import com.graduation.rescuematerial.pojo.ApplyMaterial;
import com.graduation.rescuematerial.vo.ApplyMaterialVo;
import com.graduation.rescuematerial.vo.DeliverVo;
import com.graduation.rescuematerial.vo.FuzzyOrderQueryVo;
import com.graduation.rescuematerial.vo.OrderBaseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author CaiShuangLian
 * @since 2022-04-22
 */
@Mapper
public interface ApplyMaterialMapper extends BaseMapper<ApplyMaterial> {

    List<OrderBaseVo> getAll();

    List<OrderBaseVo> unionQuery(FuzzyOrderQueryVo fuzzyOrderQueryVo);

    int applyMaterial(ApplyMaterialVo applyMaterialVo);

//    List<CheckPendingDTO> checkPending(@Param("companyName") String companyName, @Param("orderStatus") String orderStatus);

    List<AppletOrderDTO> getOrderByCompanyNameOrPhone(@Param("companyName") String companyName,@Param("phone") Long phone,@Param("status") String status);

    //获取订单当前状态
    String getStatusById(Integer orderId);

    int updateStatus(@Param("id") Integer orderId, @Param("status") String status);

    int deliver(@Param("vo") DeliverVo deliverVo, @Param("date") Date date, String way, @Param("phone") Long phone);

    int receiving(@Param("id") Integer id, @Param("date") Date date, @Param("arrive") String arrive, @Param("phone") Long userPhone);

    List<StatisticsDTO> getOrderStatistics(String companyName);
}
